<%-- 
    Document   : edit_warehouse
    Created on : 22.04.2013, 3:04:26
    Author     : Yasya
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <script src="scripts/warehouseValidator.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/warehous_add.css">
        <link rel="stylesheet" type="text/css" href="css/all.css">
        <title>Add/Edit warehouse</title>
    </head>
    <body>      
        <header>
            <div id ="top_name">
              <a href="main.jsp">  <img src="/Delta-war/product/1.jpeg"> </a>
                <h1> Edit warehouse</h1> </div>
           
        </header>
        <div id="main">
            <div id="label1">
                <p>Name:<font color="red">*</font></p>
                <p>Address:<font color="red">*</font></p>
                <p>Shipment rate:<font color="red">*</font></p>
                <p>Duration:<font color="red">*</font></p>

            </div>
            <div id="information">  
                <form method="Post" action="EditWarehouse" id="mainForm"> 


                    <input type="hidden" name="idWarehouse" size="50" value="${warehouse.getIdWarehouse()}"/>

                    <p> <input type="text" id="Name" name="Name" size="50" value="${warehouse.getName()}" oninput="validateName()"/>  
                        <span style="color: red; display:none" id="name_error" > Name should not be empty</span>
                        <span id="name_length_error" style="color: red; display:none"> Name is too long</span></p>
                    <p>  <input type="text" id="Address" name="Address" size="50" value="${warehouse.getAddress()}" oninput="validateAddress()"/>      
                        <span style="color: red; display:none" id="address_error"> Address should not be empty</span>
                        <span id="address_length_error" style="color: red; display:none"> Address is too long</span>  </p>
                    <p> <input type="text" id="ShipmentRate" name="ShipmentRate" size="50" value="${warehouse.getShipmentRate()}" oninput="validateShipmentRate()"/>  
                        <span style="color: red; display:none" id="shipmentRate_error"> Shipment rate should not be empty</span>
                        <span id="shipmentRate_number_error" style="color: red; display:none"> Shipment rate should be a number</span> </p>
                    <p> <input type="text" id="DurationKoefficient" name="DurationKoefficient" size="50" value="${warehouse.getDurationKoefficient()}" oninput="validateDurationKoefficient()"/>   
                        <span style="color: red; display:none" id="durationKoefficient_error"> Duration  should not be empty</span>
                        <span id="durationKoefficient_number_error" style="color: red; display:none"> Duration should be a number</span> </p>
                    </p>
                </form>

                <div id="buttons">
                    <div id="line_button"> <button id="func"  type="submit" onclick="submitForm_edit()">OK</button> </form> </div>
                    <div id="line_button"> <button id="func" type="submit" onclick="submitForm_delete()">Delete</button>  </form>  </div>
                    <div id="line_button"> <form method="post" action="ViewWarehouse"> <button id="func" type="submit">Cancel</button> </form> </div>
                </div>
            </div>
        </div>
                        <div id="footer">
                                <p>  &#169;All rights reserved</p>
                            </div>
    </body>
</html>